{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=3116
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
	i,ls:longint;
	s:string;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
readln(S);
writeln(s[3]);
ls:=length(s);
writeln(s[ls-1]);
writeln(copy(s,1,5));
writeln(copy(s,1,ls-2));
i:=1;
while i<=ls do begin
	write(s[i]);
	inc(i,2);
end;
writeln;
i:=2;
while i<=ls do begin
	write(s[i]);
	inc(i,2);
end;
writeln;
for i:=ls downto 1 do
	write(s[i]);
writeln;
i:=ls;
while i>0 do begin
	write(s[i]);
	dec(i,2);
end;
writeln;
write(ls);
end.